#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int x,ans=0,s=0;
bool book[5010];
int main ()
{
	freopen("dream.in","r",stdin);
	freopen("dream.out","w",stdout);
	int n,k;
	cin>>n>>k;
	for (int i=1;i<=n;i++)
	{
		cin>>x;
		if (book[x]==false)
		{
			book[x]=true;
			s++;
		}
		if (s==k)
		{
			s=0;
			ans++;
			memset(book,false,sizeof(book));
		}
	}
	cout<<ans+1;
	return 0;
}
